package com.gxitsky.classload.demo2;

/**
 * @author gxing
 * @desc TODO
 * @date 2021/12/28
 */
public class ClassLoaderMain {

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        MyClassLoader loader = new MyClassLoader();
        Class<?> clazz = Class.forName("People", true, loader);
        Object obj = clazz.newInstance();

        System.out.println(obj);
        System.out.println(obj.getClass().getClassLoader());//打印出我们的自定义类加载器
    }
}
